﻿<UserControl x:Class="Peter.Sdw.View.EditView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Sdw.Logic"
             xmlns:controls="clr-namespace:Peter.Common.Controls;assembly=Peter.Common"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DesignHeight="600"
             d:DesignWidth="200"
             d:DataContext="{d:DesignInstance logic:EditItemModel}">
   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="*" />
         <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>

      <TextBlock Grid.Row="0"
                 Grid.Column="0"
                 Text="Start Index" />
      <controls:NumericUpDown Grid.Column="0"
                              Grid.Row="1"
                              Precision="0"
                              Value="{Binding Path=StartIndex}" />
      <TextBlock Grid.Row="0"
                 Grid.Column="1"
                 Text="End Index" />
      <controls:NumericUpDown Grid.Column="1"
                              Grid.Row="1"
                              Precision="0"
                              Value="{Binding Path=EndIndex}" />

      <TabControl Grid.Row="2"
                  Grid.Column="0"
                  Grid.ColumnSpan="2"
                  TabStripPlacement="Bottom">
         <TabItem>
            <TabItem.Header>
               <StackPanel Orientation="Horizontal">
                  <icons:IconDisplay Icon="ThemeStyle"
                                     ToolTip="Styles" />
                  <TextBlock Text="Styles"
                             Margin="4,0" />
               </StackPanel>
            </TabItem.Header>
            <Grid>
               <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="60" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="60" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="60" />
               </Grid.RowDefinitions>
               <TextBlock Grid.Row="0"
                          Text="Current Styles" />
               <ListBox Grid.Row="1"
                        DisplayMemberPath="DisplayText"
                        ItemsSource="{Binding Path=Styles}"
                        SelectedItem="{Binding Path=SelectedStyle}" />
               <TextBlock Grid.Row="2"
                          Text="Start Style" />
               <TextBox Grid.Row="3"
                        Height="60"
                        Tag="{Binding}"
                        Text="{Binding Path=StartStyle}"
                        VerticalScrollBarVisibility="Auto"
                        TextWrapping="WrapWithOverflow"
                        VerticalAlignment="Stretch"
                        AcceptsReturn="True" />
               <TextBlock Grid.Row="4"
                          Text="End Style" />
               <TextBox Grid.Row="5"
                        Height="60"
                        Tag="{Binding}"
                        Text="{Binding Path=EndStyle}"
                        VerticalScrollBarVisibility="Auto"
                        TextWrapping="WrapWithOverflow"
                        VerticalAlignment="Stretch"
                        AcceptsReturn="True" />
            </Grid>
         </TabItem>
         <TabItem Visibility="{Binding Path=HasLinks, Converter={StaticResource _BoolToVisi}}">
            <TabItem.Header>
               <StackPanel Orientation="Horizontal">
                  <icons:IconDisplay Icon="Link"
                                     ToolTip="Links" />
                  <TextBlock Text="Links"
                             Margin="4,0" />
               </StackPanel>
            </TabItem.Header>
         </TabItem>
      </TabControl>

      <Border Grid.Row="0"
              Grid.RowSpan="3"
              MaxWidth="150"
              Grid.Column="0"
              Grid.ColumnSpan="2"
              Height="75"
              CornerRadius="5"
              Background="SteelBlue"
              Visibility="{Binding Path=IsLoading, Converter={StaticResource _BoolToVisi}, FallbackValue=Collapsed}">
         <TextBlock Text="Loading..."
                    FontSize="16"
                    Foreground="White"
                    FontStyle="Italic"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center" />
      </Border>
   </Grid>
</UserControl>
